-
Notifications
You must be signed in to change notification settings - Fork 7
Add a first JSON macro based on package:json/json.dart. #68
Conversation
379819c
to
f335ef9
Compare
f335ef9
to
79fa863
Compare
Filed an issue #70 for the templating discussion, with some initial thoughts on the topic :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I realize I added a lot of TODOs rather than making changes in this PR, hopefully that's not too annoying, they all seem fairly big and about equal priority so splitting to many PRs seems like a good way to keep things moving.
@@ -11,6 +11,16 @@ | |||
"isField": true, | |||
"isMethod": false, | |||
"isStatic": false | |||
}, | |||
"returnType": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely: as we discussed we probably want to end up with something flat but probably still giving basic "available properties" at each point.
Added a TODO in definitions.dart
// TODO(davidmorgan): make Member
a union.
Congratulations 🙌 |
Adds a minimal JSON macro, lots of TODOs.
Adds return types for fields to the model + (analyzer only) query handling.
Skip golden tests for analyzer/CFE if there are no goldens, instead of failing.
Uses templating for identifiers as suggested in dart-lang/language#1989 (comment) ... this is just a proof of concept, we should discuss whether we want templating and if so how it fits into the overall design: it could be client side only or we make the template format part of the protocol. (In the sense of "this string has this specified format which won't change, if you want something different add a new type / field").
I didn't look too closely at the augmentation golden file, just make it approximately match the package:json/json.dart output for the same code. I realize we need yet another type of test, to compile the code with macro applications and then test with it, which in this case would test the JSON produced by the JSON macro. I'll look at how to add that...